#include "SelectorImpl.h"

PseudoElementSelectorImpl::PseudoElementSelectorImpl()
{

}

PseudoElementSelectorImpl::PseudoElementSelectorImpl(const string& alocalName)
	:localName(alocalName)
{

}

PseudoElementSelectorImpl::~PseudoElementSelectorImpl()
{

}

Selector* PseudoElementSelectorImpl::Copy()const
{
	return new PseudoElementSelectorImpl(localName);
}

Selector::SelectorType PseudoElementSelectorImpl::getSelectorType()const
{
	return Selector::SAC_PSEUDO_ELEMENT_SELECTOR;
}

const string* PseudoElementSelectorImpl::toString()const
{

	string* result = NULL;
	try
	{
		result = new string();
		result->append(":");
		result->append(localName);
	}catch(std::exception& e)
	{
		if(result)
			delete result;
		return NULL;
	}
	return result;
}

const string* PseudoElementSelectorImpl::getNamespaceURI()const
{
	return NULL;
}

const string* PseudoElementSelectorImpl::getLocalName()const
{
	if(localName.empty())
		return NULL;
	return &localName;
}
